<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
require_once(JPATH_SITE.DS.'components'.DS.'com_ecommerce'.DS.'models'.DS.'list.php');
$model = new EcommerceModelList();
// Load the virtuemart main parse code
function formatPrice($number){
	$number = number_format($number,2,",","");
	return str_replace(",00", ",-", $number);
}
//Start of routine output correct div to enable ajax update to display correctly
$cart = array();
if(!empty($_SESSION["cart"])){
	$cart = $_SESSION["cart"];
}
$totalprice = 0;		
foreach ($cart as $pro){
	$price = $model->getPriceById($pro["category_id"],$pro["product_id"],$pro["producttype_id"]);
	$totalprice += $price;
}
$html  = '<a class="bestil-info" href="#">';
$html .= 'Antal ydelser : <strong>'.count($cart).'</strong> <br/>';		
$html .= 'Total beløb : <strong>'.formatPrice($totalprice).' DKK</strong>';
$html .= '</a>';
echo $html;
?>